package main

import (
	"log"
	"database/sql"
	_ "github.com/go-sql-driver/mysql"
)

func main() {
	dsn := "devops:Secops@123@tcp(localhost:3306)/test"
	//dsn := "root:Sevops@123@tcp(localhost:3306)/test"
	db, err := sql.Open("mysql", dsn)
	if (err != nil) {
		log.Fatalf("sql.Open error: %v\n", err);
	}
	err = db.Ping()
	if (err != nil) {
		log.Fatalf("sql.Ping error: %v\n", err);
	}
	log.Println("sql connect success")
}

